﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;
using BitworkStudios.WikiParse.Core.Contracts;
using BitworkStudios.WikiParse.Core.Extensions;
using BitworkStudios.WikiParse.Core.Models;

namespace BitworkStudios.WikiParse.Web.Controllers
{
    public class HomeController : ControllerBase
    {
        public ActionResult Index()
        {
            ViewBag.Title = "Home Page";

            return View();
        }

        [HttpPost]
        public ActionResult Upload(HttpPostedFileBase sourceFile)
        {
            UploadedFileInformation fileInformation = WikiParser.ProcessFile(sourceFile.InputStream); 
            return Json(fileInformation);
        }
    }
}
